all: help

help:
	@echo
	@echo "Cross toolchains:"
	@echo "make cross-i686     - build i686 crosstools"
	@echo "make cross-arm      - build ARM crosstools"
	@echo
	@echo "Target firmware:"
	@echo "make fw-i686        - build i686 firmware"
	@echo "make fw-arm         - build ARM firmware"
	@echo "make eyespy-i686    - build EyeSpy i686"
	@echo
	@echo "make clean          - clean builder directory"
	@echo "make clean-images   - remove images directory"
	@echo "make dep-packages   - install addon builder dependencies"
	@echo

dep-packages:
	aptitude install autoconf automake bison build-essential cmake fakeroot flex gawk git-core gperf gtk-doc-tools \
	intltool libbz2-dev libcap-dev libglib2.0-dev libxml-simple-perl libxml2-dev lzma m4 rpm sharutils subversion \
	texinfo x11-xkb-utils xmlto zlib1g-dev zip libgtk2.0-dev libtool libgd2-xpm-dev libsdl1.2-dev xfonts-utils

imagedir:
	mkdir -p images
	ln -sf ../images builder/images

clean:
	@cd builder && ./build-crosstools.sh clean
	@rm -rf images

cross-i686:
	cd builder && ./build.sh ../bsp-asko/build-crosstools-i686.sh

cross-arm:
	cd builder && ./build.sh ../bsp-asko/build-crosstools-arm-gnueabi.sh

fw-i686: imagedir
	cd builder && ./build.sh ../bsp-asko/build-linux-i686.sh

fw-arm: imagedir
	cd builder && ./build.sh ../bsp-asko/build-linux-arm.sh

eyespy-i686: imagedir
	cd builder && ./build.sh ../bsp-asko/build-eyespy-i686.sh
